import { ElNotification, ElMessageBox } from 'element-plus'
import nprogress from 'nprogress'

// 成功提示
export const toast = (
  message,
  type = 'success',
  dangerouslyUseHTMLString = false
) => {
  ElNotification({
    message: message,
    type: type,
    duration: 3000,
    dangerouslyUseHTMLString,
  })
}

// 提示框
export const showModal = (
  content = '提示内容',
  type = 'warning',
  title = ''
) => {
  return ElMessageBox.confirm(title, content, {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type,
  })
}

// 显示全屏loading
export const showFullLoading = () => {
  nprogress.start()
}

// 隐藏全屏loading
export const hideFullLoading = () => {
  nprogress.done()
}
